<#assign pageName="新增流程模型">
<@override name="head-styles">
</@override>
<@override name="page-content">
    <form class="layui-form padding-10" lay-filter="formFlowModelAdd">
        <div class="layui-row">
            <div class="layui-col-xs10">
                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <b style="color:red;padding:2px;vertical-align: middle;">*</b>模型类型
                    </label>
                    <div class="layui-input-block">
                      <select name="type" lay-verify="required">
                        <option value="">—请选择—</option>
                        <#list workflowTypeMap?keys as key>
                            <option value="${key}">${workflowTypeMap[key]}</option>
                        </#list>
                      </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" for="key">
                        <b style="color:red;padding:2px;vertical-align: middle;">*</b>模型KEY
                    </label>
                    <div class="layui-input-block">
                        <input type="text" id="key" name="key" autocomplete="off" placeholder="请输入模型KEY" class="layui-input" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" for="name">
                        <b style="color:red;padding:2px;vertical-align: middle;">*</b>模型名称
                    </label>
                    <div class="layui-input-block">
                        <input type="text" id="name" name="name" autocomplete="off" placeholder="请输入模型名称" class="layui-input" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" for="version">
                        <b style="color:red;padding:2px;vertical-align: middle;">*</b>模型版本
                    </label>
                    <div class="layui-input-block">
                        <input type="text" id="version" name="version" autocomplete="off" placeholder="请输入模型版本" class="layui-input" lay-verify="required|number">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" for="description">模型描述</label>
                    <div class="layui-input-block">
                        <input type="text" id="description" name="description" autocomplete="off" placeholder="请输入模型描述" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <@ctrl.FormAction buttons=['submit','reset'] backURL="manage" class="no-margin align-center"/>
    </form>
</@override>
<@override name="page-scripts">
    <script>
    $(function(){
        layui.use(['form','layer','jquery'], function(){
            var layer=layui.layer;
            var form = layui.form;
            $=layui.jquery;
            form.on('select', function(data){
                $('#key').val(data.value);
                $('#name').val(data.elem[data.elem.selectedIndex].text);
            })
            //监听提交
            form.on('submit(submit)', function(data){
                submitData(data.field, '${contextPath}/workflow/model/add', function(){
                    setTimeout(function () {
                         parent.layer.close(parent.layer.getFrameIndex(window.name));
                         window.parent.location.reload();
                     }, 1500);
                });
                return false;
            });
        });
    })
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 